package com.ag.wzp.bak;

import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.SessionAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.ag.common.BaseAction;
import com.ag.common.IPermissionService;
import com.ag.wzp.service.impl.DisposalServiceImpl;
/**
 * 处置建议的增删改
 * @author 温镇澎
 *
 */
@Scope("prototype")
@Controller("disposalAdviceAction")
public class DisposalAdviceAction extends BaseAction implements SessionAware{
	private static final long serialVersionUID = 1L;
	private static final Logger logger = Logger.getLogger(DisposalAdviceAction.class);
	
	@Resource(name="dispoalServiceImpl")
	private DisposalServiceImpl disposalServiceImpl;
	/**
	 * 调用权限服务逻辑组件
	 */
	@Resource(name = "PermissionServiceImpl")
	private IPermissionService pms;
	/**
	 * 提供Map<String, Object>类型的Session变量，用来保存Struts2注入的Session上下文
	 */
	private Map<String, Object> sessionMap;
	private String EId;
	private String daContent;
	
	public String save(){
		logger.info("daContent="+daContent);
		this.disposalServiceImpl.save(pms.getCurrentUser(sessionMap),EId,daContent);
		return SUCCESS;
	}

	@Override
	public void setSession(Map<String, Object> session) {
		this.sessionMap = session;
		
	}

	public void setEId(String eId) {
		EId = eId;
	}

	public void setDaContent(String daContent) {
		this.daContent = daContent;
	}
	
}
